<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body onLoad="init()">
<div>
<table style="margin:auto;font-size:50px">
    <tbody>
    <tr>
        <td style="text-align: right">发证单位：</td>
        <td><span id="orgName"></span></td>
    </tr>
    <tr>
        <td style="text-align: right">奖项名字：</td>
        <td><span id="dipName"></span></td>
    </tr>
    <tr>
        <td style="text-align: right">发证码：</td>
        <td><span id="code"></span></td>
    </tr>
    </tbody>
</table>
</div>
<script type="text/javascript" src="../libs/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
    var SERVER_HOST = 'http://www.51dzzs.com';

    function init() {
        var prizeId = getUrlKey('prizeId');
        $.ajax({
            url: SERVER_HOST + '/busine/prizes/detail',
            type: 'POST',
            data: {
                id: prizeId
            },
            success: (res) => {
                var data = res.data;
				$("#orgName").text(data.theme ? data.theme.putWorker : '');
				$("#dipName").text(data.diplomas ? data.diplomas.name : '');
				$("#code").text(data.id);
            }
        });
    }

    function getUrlKey(name) {
        var paramReg = new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)');
        return decodeURIComponent((paramReg.exec(location.href) || [''])[1].replace(/\+/g,'%20')) || null
    }
</script>
</body>
</html>